package com.kaka.bus.engine.amount.TopProduct;

import com.kaka.bus.constant.Constant;
import com.kaka.bus.di.DataManager;
import com.kaka.bus.engine.common.impl.LoanService;
import com.kaka.bus.manager.Result;
import com.kaka.bus.manager.T;
import com.kaka.bus.mvp.RxPresenter;

import javax.inject.Inject;

public class TopPresenter extends RxPresenter<TopContract.TopView> implements TopContract.TopPresenter {
    private LoanService mLoanService;

    @Inject
    public TopPresenter(DataManager dataManager, LoanService loanService) {
        super(dataManager);
        mLoanService = loanService;
        setService(mLoanService);
    }


    @Override
    public void chargeApply(String productId, String bannerId, String perId, String chargeProductId) {
        addSubscribe(mDataManager.getApi().chargeApply("apply", productId, bannerId, Constant.PLATFORM, perId, "1")
                .compose(T.D())
                .subscribeWith(new Result<String>() {
                    @Override
                    protected void onSuccess(String stringHttpWrapper) {

                    }
                })
        );
    }
}
